﻿// NaverContext.cs
//

using System;
using System.Collections.Generic;
using System.Linq;

namespace LinqProviders.LinqToNaver {

    public class NaverContext {

        private NaverQueryProvider _queryProvider;

        public NaverContext(string appKey) {
            if (String.IsNullOrEmpty(appKey)) {
                throw new ArgumentNullException("appKey");
            }
            _queryProvider = new NaverQueryProvider(appKey);
        }


        /// <summary>
        /// Gets the rank. 실시간 검색어
        /// </summary>
        /// <value>The rank.</value>
        public INaverQueryable<RankSearchResult> Ranks
        {
            get
            {
                return new NaverQuery<RankSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the images. 이미지 검색
        /// </summary>
        /// <value>The images.</value>
        public INaverQueryable<ImageSearchResult> Images {
            get {
                return new NaverQuery<ImageSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the newsis. 뉴스 검색
        /// </summary>
        /// <value>The newsis.</value>
        public INaverQueryable<NewsSearchResult> Newsis
        {
            get
            {
                return new NaverQuery<NewsSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the videos. 동영상 검색
        /// </summary>
        /// <value>The videos.</value>
        public INaverQueryable<VideoSearchResult> Videos
        {
            get
            {
                return new NaverQuery<VideoSearchResult>(_queryProvider);
            }
        }

        /// <summary> 
        /// Gets the pages. 웹페이지 검색
        /// </summary>
        /// <value>The pages.</value>
        public INaverQueryable<PageSearchResult> Pages {
            get {
                return new NaverQuery<PageSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the blogs. 블로그 검색
        /// </summary>
        /// <value>The blogs.</value>
        public INaverQueryable<BlogSearchResult> Blogs
        {
            get
            {
                return new NaverQuery<BlogSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the recommend. 추천 검색어
        /// </summary>
        /// <value>The recommend.</value>
        public INaverQueryable<RecmdSearchResult> Recommends
        {
            get
            {
                return new NaverQuery<RecmdSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the websites. 웹페이지 검색
        /// </summary>
        /// <value>The websites.</value>
        public INaverQueryable<WebkrSearchResult> Webkrs
        {
            get
            {
                return new NaverQuery<WebkrSearchResult>(_queryProvider);
            }
        }
        /// <summary>
        /// Gets the kin. 지식인 검색
        /// </summary>
        /// <value>The kin.</value>
        public INaverQueryable<KinSearchResult> Kins
        {
            get
            {
                return new NaverQuery<KinSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the docs. 전문자료 검색
        /// </summary>
        /// <value>The docs.</value>
        public INaverQueryable<DocSearchResult> Docs
        {
            get
            {
                return new NaverQuery<DocSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the shops. 쇼핑 검색
        /// </summary>
        /// <value>The shops.</value>
        public INaverQueryable<ShopSearchResult> Shops
        {
            get
            {
                return new NaverQuery<ShopSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the encycs. 백과사전 검색
        /// </summary>
        /// <value>The encycs.</value>
        public INaverQueryable<EncycSearchResult> Encycs
        {
            get
            {
                return new NaverQuery<EncycSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the eratas. 오타 검색
        /// </summary>
        /// <value>The erratas.</value>
        public INaverQueryable<ErrataSearchResult> Erratas
        {
            get
            {
                return new NaverQuery<ErrataSearchResult>(_queryProvider);
            }
        }

        /// <summary>
        /// Gets the cafes. 카페 검색.
        /// </summary>
        /// <value>The cafes.</value>
        public INaverQueryable<CafeSearchResult> Cafes
        {
            get
            {
                return new NaverQuery<CafeSearchResult>(_queryProvider);
            }
        }
    }
}
